﻿using UnityEngine;
using System.Collections;

public delegate void GreetingDelegate(string name);
public class delegateManager
{
    public GreetingDelegate delegate_one;
    public void GreetPeople(string name)
    {
        if (delegate_one != null)
            delegate_one(name);
    }
}

public class delegate_test_two : MonoBehaviour
{

    public void ChineSay(string name)
    {
        Debug.LogError("chinese name:"+name );
    }
   
    public void EnglishSay(string name)
    {
        Debug.LogError("english name:" + name );
    }


    public void yinEventClick()
    {
        delegateManager greetDe = new delegateManager();
        greetDe.delegate_one += ChineSay;
        greetDe.delegate_one += EnglishSay;
        greetDe.GreetPeople("caojianlin");
    }

}


